package com.chinacoal.microservice;


import com.chinacoal.microservice.fallback.DataCenterClientFallback;
import com.chinacoal.microservice.pojo.CcmsSmartleasingDeviceManagement;
import com.chinacoal.microservice.pojo.CcmsSmartleasingHistoricalPayment;
import com.chinacoal.microservice.pojo.CcmsSmartleasingRegionalAnalysis;
import com.chinacoal.microservice.pojo.DataCenter;
import com.chinacoal.microservice.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author zhuliang
 * @version V1.0
 * @Description: 数据中心和可视化页面-接口
 * @date 2020-12-29 10：10
 */
@Api(tags = {"数据中心和可视化页面-接口"})
@FeignClient(name = "${spring.application.name}",fallback = DataCenterClientFallback.class,configuration = FeignAutoConfiguration.class)
public interface DataCenterClient {

    /**
     * @Description: 费用概况和实时概况
     * @author zhuliang
     * @date 2020/12/29 10:18
     */
    @ApiOperation(value = "费用概况和实时概况")
    @GetMapping("smartleasing/dataCenter/costOverview")
    public Result<DataCenter> costOverview();

    /**
     * @Description: 得到分析数据
     * @author zhuliang
     * @date 2020/12/30 11:51
     */
    @ApiOperation(value = "得到综合分析数据")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "year", value = "年份", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "path", name = "type", value = "类别: 0所有季度，1第一季度，2第二季度，3第三季度，4第四季度", required = true, dataType = "Integer")
    })
    @GetMapping("smartleasing/dataCenter/getComprehensiveAnalysisData/{year}/{type}")
    public Result<List<CcmsSmartleasingHistoricalPayment>> getComprehensiveAnalysisData(@PathVariable("year") String year,
                                                                                        @PathVariable("type") Integer type);

    /**
     * @Description: 得到区域分析数据
     * @author zhuliang
     * @date 2020/12/31 10:22
     */
    @ApiOperation(value = "得到区域分析数据")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "type", value = "类别: 0默认5个，1所有数据", required = true, dataType = "Integer")
    })
    @GetMapping("smartleasing/dataCenter/getAreaAnalysisData/{type}")
    public Result<List<CcmsSmartleasingRegionalAnalysis>> getAreaAnalysisData(@PathVariable("type") Integer type);

    /**
     * @Description: 得到房间面积数据
     * @author zhuliang
     * @date 2021/1/8 10:03
     */
    @ApiOperation(value = "得到房间面积数据")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "type", value = "类别: 0查询，1刷新数据", required = true, dataType = "Integer")
    })
    @GetMapping("smartleasing/dataCenter/getAreaData/{type}")
    public Result<DataCenter> getAreaData(@PathVariable("type") Integer type);

    /**
     * @Description: 可视化页面房间统计数据
     * @author zhuliang
     * @date 2021/1/11 16:27
     */
    @ApiOperation(value = "可视化页面房间统计数据（左）")
    @GetMapping("smartleasing/dataCenter/getVisualizationRoomData")
    public Result<List<CcmsSmartleasingDeviceManagement>> getVisualizationRoomData();

    /**
     * @Description: 得到所有有记录的年份
     * @author zhuliang
     * @date 2021/1/15 16:21
     */
    @ApiOperation(value = "得到所有有记录的年份")
    @GetMapping("smartleasing/dataCenter/getAllByYear")
    public Result<List<String>> getAllByYear();

    /**
     * @Description: 可视化页面房间统计数据（右）
     * @author zhuliang
     * @date 2021/1/26 18:38
     */
    @ApiOperation(value = "可视化页面房间统计数据（右）")
    @GetMapping("smartleasing/dataCenter/getVisualizationStatisticalData")
    public Result<CcmsSmartleasingDeviceManagement> getVisualizationStatisticalData();
}
